package kr.co.dongpang.android;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.widget.ImageView;

public class CustomImageView extends ImageView {
	
	private int count = 0;

	public CustomImageView(Context context) {
		super(context);
	}
	@SuppressLint("DrawAllocation")
	@Override
	protected void onDraw(Canvas canvas) {
		Paint paint = new Paint();
        paint.setColor(Color.WHITE); 
        paint.setStyle(Style.FILL);                
        paint.setTextSize(25);
        paint.setTextAlign(Align.CENTER);
        if(count != 0){
        	canvas.drawText(""+count, 132, 115, paint);
        }
		super.onDraw(canvas);
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	
}
